package com.norbitltd.guavaleaves.java.util;

import java.util.Calendar;
import java.util.Date;

import com.google.common.base.Function;
import com.norbitltd.guavaleaves.java.lang.ObjectFunctions;

public class CalendarFunctions extends ObjectFunctions {
	
	public static Function<Calendar, Date> toDate() {
		return new Function<Calendar, Date>() {
			public Date apply(Calendar input) {
				return input.getTime();
			}
		};
	}
	
	public static Function<Calendar, Long> toLong() {
		return new Function<Calendar, Long> () {
			public Long apply(Calendar input) {
				return input.getTimeInMillis();
			}
		};
	}
}
